import 'package:flutter/material.dart';
import '../../../../lib_baseview/widget/jr_refresh_list_mixin.dart';
import 'user_list_kick_item_widget.dart';

class UserListKickPage extends StatefulWidget {
  final int rid;

  const UserListKickPage({Key? key, required this.rid}) : super(key: key);

  @override
  State<UserListKickPage> createState() => _UserListKickPageState();
}

class _UserListKickPageState extends State<UserListKickPage>
    with JRRefreshListMixin {
  @override
  void initState() {
    super.initState();

    itemBuilder = (context, index) => UserListKickItemWidget(
          rid: widget.rid,
          index: index,
          // item: data?[index],
          onUnset: () {
            loadData();
          },
        );

    loadData();
  }

  @override
  Future<void> loadData() async {
    // var apiResult = await Api.getKickList(widget.rid);

    // if (apiResult.isSuccess) {
    //   data = apiResult.data?.items;
    // } else {
    //   errorMsg = apiResult.errorMsg;
    // }

    // if (mounted) setState(() {});
  }

  @override
  Widget build(BuildContext context) {
    return root;
  }
}
